<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$Think.config.TITLE}--用户登录</title>
<link rel="icon" href="__ROOT__/Public/img/sip.ico" type="image/x-icon" />
<link rel="shortcut icon" href="__ROOT__/Public/img/sip.ico" type="image/x-icon" />
<link href="{$Think.config.static_path}login/css/login.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<link href="{$Think.config.static_path}login/css/demo.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="{$Think.config.static_path}login/js/jquery1.42.min.js"></script>
<script type="text/javascript" src="{$Think.config.static_path}login/js/jquery.SuperSlide.js"></script>
<script type="text/javascript" src="{$Think.config.static_path}login/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
$(function() {

    $(".i-text").focus(function() {
        $(this).addClass('h-light');
    });

    $(".i-text").focusout(function() {
        $(this).removeClass('h-light');
    });

    $("#username").focus(function() {
        var username = $(this).val();
        if (username == '输入账号') {
            $(this).val('');
        }
    });

    $("#username").focusout(function() {
        var username = $(this).val();
        if (username == '') {
            $(this).val('输入账号');
        }
    });

    $("#password").focus(function() {
        var username = $(this).val();
        if (username == '输入密码') {
            $(this).val('');
        }
    });



});

$(document).ready(function() {
    $("#IbtnEnter").click(function() {
        user_Login();
    });
    $(document).keydown(function(event) {
        if (event.keyCode == 13) {
            user_Login();
        }
    });
});

function fleshVerify() {
    var timenow = new Date().getTime();
    $('#verifyImg').attr("src", '__URL__/verify/' + timenow);
}
function user_Login() {
    var username = $("#username").val();
    var password = $("#password").val();

    var yzm = $("#yzm").val();
    if (username == "" || username == '输入账号') {
        alert("用户名不能为空");
        $('#username').focus();
        return false;
    } else if (password == "") {
        alert("密码不能为空");
        $('#password').focus();
        return false;
    } else {
        $.post('__URL__/checkLogin', {
            username: username,
            password: password,
            yzm: yzm
        },
        function(json) {

            if (json.status == 1) {
		
                window.location.href = "__APP__/Index/";
            }else if(json.status == 2){
			
				window.location.href = "__APP__/"+json.url+"/orderList/?id="+json.data;
			} 
			
			else {
                alert(json.info);
            }
        });
    }

}

</script>
</head>

<body>
<div class="header">
  <h1 class="headerLogo">{$Think.config.TITLE}</h1>
</div>

<div class="banner">
  <div class="login-aside">
    <div id="o-box-up"></div>
    <div id="o-box-down"  style="table-layout:fixed;">
      <div class="error-box"></div>
      <form class="registerform"action="__URL__/checkLogin">
        <div class="fm-item">
          <label for="logonId" class="form-label">系统登陆：</label>
          <input type="text" value="输入账号" maxlength="100" id="username" class="i-text"   >
          <div class="ui-form-explain"></div>
        </div>
        <div class="fm-item">
          <label for="logonId" class="form-label">登陆密码：</label>
          <input type="password" value="" maxlength="100" id="password" class="i-text">
          <div class="ui-form-explain"></div>
        </div>
       
        <div class="fm-item">
          <label for="logonId" class="form-label"></label>
          <input type="button" value="" tabindex="4" id="IbtnEnter" class="btn-login">
          <div class="ui-form-explain"></div>
        </div>
      </form>
    </div>
  </div>
  <div class="bd">
    <ul>
      <li style="background:url({$Think.config.static_path}login/themes/bg.jpg) center 0 no-repeat;"></li>
    </ul>
  </div>
  <div class="hd">
    <ul>
    </ul>
  </div>
</div>
<script type="text/javascript">jQuery(".banner").slide({ titCell:".hd ul", mainCell:".bd ul", effect:"fold",  autoPlay:true, autoPage:true, trigger:"click" });</script>
<div class="banner-shadow"></div>
<div class="footer" style="margin-bottom:100px;">
  <p>Copyright &copy; 2015. 投票系统 All rights reserved.</p>
  <p style="margin-top:6px; color:green;">建议使用火狐、谷歌Chrome或者safari浏览器,以获得更完美的体验。 </p>
</div>
</body>
</html>
